<template>
  <dt-modal-edit ref='edit' :title='title' :label-width='130' :width='500' @ok='onOk'
    okText='新建'>
  </dt-modal-edit>
</template>

<script>
  import createActivityOpt from '../opt/create'
  // import initiateMgr from '@/biz/commission/initiate.js'
  import activityMgr from '@/biz/activity/activity'


  export default {
    data() {
      return {
        info: {
          activityName: ''
        },
        title: '新建活动'
      }
    },
    mounted() {},
    methods: {
      show() {
        this.$refs.edit.show(createActivityOpt.options(), this.info)
      },
      hide() {
        this.$refs.edit.hide()
      },
      onOk() {

        let params = {
          housesId: this.$dt.buildInfo().housesId,
          name: this.info.activityName
        }
        activityMgr.insertBasics(params).then((res) => {
          this.$router.push({
            path: '/marketingCenter/activityManagement/addEditActivity',
            query: {
              acId: res
            },
          })

        })
        console.log(this.info, '弹框中的信息')


        // incentiveMgr.saveBonusStimulate(this.info).then((res) => {
        //   console.log(res, '新建成功')
        //   this.$emit('success', res)
        //   this.hide()
        // })
      },
    },
  }
</script>

<style>
</style>